import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path')

// https://vitejs.dev/config/
export default ({ mode }) => defineConfig({
  resolve: {
    // 定义别名 @
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  server: {
    host: '0.0.0.0',
    port: '9826',
    // hmr: true,
    // proxy: {
    //   '/api': {
    //     target: loadEnv(mode, process.cwd()).VITE_BASE_API,
    //     changeOrigin: true,
    //   }
    // }
  },
  plugins: [vue()]
})
